<!DOCTYPE html>
<html>
<head>
    <title>map函数测试</title>
    <meta charset="utf-8"/>
    <script src="../../../js/jquery-1.10.1.min.js"></script>
    <script>
       $().ready(function(){
           $(document).on("click", "#testBtn", function(){
               var array = $.map([0, 1, 2], function(n){
                   return n + 3;
               });
               alert(array);

               var programObj = [{"programId": 111, "size": 2, files: [{"trimIn": 0, "trimOut": 200, "path": "http://100.0.0.10"}, {"trimIn": 100, "trimOut": 150, "path": "http://100.0.0.10"}]}];
               var tempObj = $.map(programObj, function(n){
                   return n;
               });
               //数组中含有对象，不能复制成功
               alert(programObj[0].files[0].trimIn);
               programObj[0].files[0].trimIn = 500;
               alert(programObj[0].files[1].trimIn);
               alert(tempObj[0].files[0].trimIn);

           });

       });
    </script>
</head>
<body>
    <p>map函数测试
        <input id="testBtn" type="button" value="Test"/>
    </p>
</body>
</html>